/*
 *	MIDAS Context Based Routing
 *	cbr_eth.h
 *	Copyright (c) 2007 Bartlomiej Zolnierkiewicz
 *	MEAG IT PW
 */

#ifndef __CBR_ETH_H
#define __CBR_ETH_H

#include <linux/if_ether.h>
#include <linux/types.h>

#include "cbr_acache.h"

#define ETH_P_CBR 0x8080

int eth_socket_create(const char *, int &);

int eth_send(int, int, mac_addr *, mac_addr *, __u16, void *);

int eth_recv(int, void *, mac_addr *, __u16);

static inline int eth_cbr_send(int s, int i,
			       mac_addr *src_mac, mac_addr *dst_mac,
			       void *payload)
{
	return eth_send(s, i, src_mac, dst_mac, ETH_P_CBR, payload);
}

static inline int eth_cbr_recv(int s, void *payload, mac_addr *src_mac)
{
	return eth_recv(s, payload, src_mac, ETH_P_CBR);
}

#endif
